
cmake_minimum_required(VERSION 3.22.1)

project("libx264")

include_directories(
        ./
        ./include/
)

add_library(${CMAKE_PROJECT_NAME} SHARED
        libx264.cpp)

add_library(x264-lib
        SHARED
        IMPORTED)

set_target_properties(x264-lib
        PROPERTIES IMPORTED_LOCATION
        ${CMAKE_SOURCE_DIR}/lib/${ANDROID_ABI}/libx264.so)

target_link_libraries(${CMAKE_PROJECT_NAME}
        android
        x264-lib
        log)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")#设置编译级别为03,提高运行效率,但会降低编译效率